<!--折线饼状-->
<template>
  <div class="dashboard-editor-container">
    <!--数量-->
    <panel-group />
    <!--大横向折线图-->
    <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;">
      <span>当前设备状态</span>
      <line-chart :chart-data="lineChartData" />
    </el-row>
    <el-row :gutter="32">
      <!--左-->
      <el-col :xs="12" :sm="12" :lg="12">
        <div class="chart-wrapper">
          <span>设备区</span>
          <raddar-chart />
        </div>
      </el-col>
      <!--右-->
      <el-col :xs="12" :sm="12" :lg="12">
        <div class="chart-wrapper">
          <span>应用</span>
          <pie-chart />
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
// import { getEchartData } from '@/api/codeapi'
import PanelGroup from './components/PanelGroup'
import LineChart from './components/LineChart'
import RaddarChart from './components/RaddarChart'
import PieChart from './components/PieChart'
// import BarChart from './components/BarChart'
// import BoxCard from './components/BoxCard'

/* 折线图的*/

const lineChartData = {
  /* newVisitis: {
    expectedData: [10, 60, 70, 40, 15, 20, 40],  //在线设备数据
    actualData: [10, 52, 30, 30, 12, 30, 30]       //离线设备数据
  },*/
  /* messages: {
    expectedData: [200, 192, 120, 144, 160, 130, 140],
    actualData: [180, 160, 151, 106, 145, 150, 130]
  },*/
  /* purchases: {
    expectedData: [80, 100, 121, 104, 105, 90, 100],
    actualData: [120, 90, 100, 138, 142, 130, 130]
  },*/
  /* shoppings: {
    expectedData: [130, 140, 141, 142, 145, 150, 160],
    actualData: [120, 82, 91, 154, 162, 140, 130]
  }*/
}

export default {
  name: 'DashboardAdmin',
  components: {
    PanelGroup,
    LineChart,
    RaddarChart,
    PieChart
    // BarChart,
    // BoxCard
  },
  data() {
    return {
      lineChartData: lineChartData.newVisitis
    }
  },
  methods: {
    /* handleSetLineChartData(type) {
      this.lineChartData = lineChartData[type]
    }*/
  }
}
</script>

<style lang="scss" scoped>
.dashboard-editor-container {
  padding: 32px;
  background-color: rgb(240, 242, 245);
  position: relative;

  .github-corner {
    position: absolute;
    top: 0px;
    border: 0;
    right: 0;
  }

  .chart-wrapper {
    background: #fff;
    padding: 16px 16px 0;
    margin-bottom: 32px;
  }
}

@media (max-width:1024px) {
  .chart-wrapper {
    padding: 8px;
  }
}
</style>
